--[[ * 召唤物继承主人的技能]]

---@class BuffEffect3802100 : BaseBuffEffect
BuffEffect3802100 = ClientFight.CreateClass("BuffEffect3802100", ClientFight.BaseBuffEffect)
local t = BuffEffect3802100

---@param fight Fight
---@param buff FighterBuff
function t:add(fight, buff)

    local target = buff.target;
    if (not target:isSummons()) then
        return IBuffEffect.FAIL;
    end
    local parent = target.summonsCreater;
    if (parent == nil) then
        return IBuffEffect.FAIL;
    end
    local skillGroup = buff.buffBean.f_BuffEffectValue[1];
    if (skillGroup == 0) then
        return IBuffEffect.FAIL;
    end
    local skills = clone(parent.skills);
    table.addAllToArr(skills, parent.passiveskills);
    for k, skill in pairs(skills) do
        if (skill.skillType == skillGroup) then
            --继承爸爸的技能
            SkillManager.addSkill(fight, target, skill.skillId, skill.skillType);
            FighterManager.addPassiveSkillEffect(fight, target);
            break ;
        end
    end
    return ClientFight.BaseBuffEffect.add(self, target, fight, buff);
end

t.New()